import 'package:flutter/material.dart';
import 'MyIcon.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'ImageAndIcon',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyStatelessWidget(),
    );
  }
}

class MyStatelessWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    //定义文本样式

    return Scaffold(
      appBar: AppBar(
        title: Text("ImageAndIcon"),
      ),
      body: Column(
        children: <Widget>[
          //图片,加载本地资源
          Image.asset("static/images/fengjing.jpg",
          width: 200,),
          //图片,加载网络资源
          Image.network("http://file02.16sucai.com/d/file/2015/0408/779334da99e40adb587d0ba715eca102.jpg",
            //填充
            fit: BoxFit.cover,
            //混合模式
            color: Colors.blue,
            colorBlendMode: BlendMode.difference,),
          //图标
          Icon(
            Icons.access_alarm
          ),
          //支持iconfont
          Icon(
            MyIcon.hawei,
            color: Colors.yellow,
          ),
          Icon(
            MyIcon.xiaomi,
            color: Colors.red,
          )
        ],
      ),
    );
  }

}
